# @Author: Eric Ito
# @Date: 1/26/2009
# @Name: Project Euler Problem 15

"""
Starting at the top left of a 20x20 grid, how many routes are there
to the bottom right grid
"""


def main():
    grid = []
    for i in range(0,400):
        grid.append(0)

    grid[399] = 2
    for i in range(398,-1,-1):
        if (i+1) % 20 == 0:
            # we are on right edge
            grid[i] = grid[i+20] + 1
        elif i/379 == 1:
            print i
            # we are on bottom edge
            grid[i] = grid[i+1] + 1
        else:
            grid[i] = grid[i+20] + grid[i+1]
    print grid[0]

if __name__ == "__main__":
    main()